package com.yang.SpringTest.annotation.importLearn;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

/**
 * <p>description</p>
 *
 * @author By: chengxuyuanshitang
 * Package com.yang.SpringTest.annotation.importLearn
 * Ceate Time 2024-03-14 14:22
 */

public class ImportBeanDefinitionDemoRegistrar implements ImportBeanDefinitionRegistrar {
    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
        String beanName = ImportBeanDefinitionRegistrarDemoBean.class.getName();
        BeanDefinition beanDefinition = new RootBeanDefinition(ImportBeanDefinitionRegistrarDemoBean.class);
        registry.registerBeanDefinition(beanName, beanDefinition);
    }
}
